﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'P_GetUserPassword')
	BEGIN
		DROP  Procedure  [esf_sso].P_GetUserPassword
	END

GO

CREATE Procedure [esf_sso].P_GetUserPassword
	@pEmail						VARCHAR (150)
	,@pSecurityQuestionID		BIGINT
	,@pSecurityQuestionAnswer	VARCHAR (60)
AS

	SELECT 
		VU.*
	FROM
		[esf_sso].[VUser] VU
	WHERE 
		VU.Usr_Per_Email = @pEmail
		AND VU.Usr_Sqa_ID = @pSecurityQuestionID
		AND VU.Usr_SecurityQuestionAnswer = @pSecurityQuestionAnswer

GO